package com.czapl.towers;

import com.badlogic.gdx.math.Vector2;
import com.czapl.api.IProjectile;
import com.czapl.api.IUnit;
import com.czapl.drawing.CTower;
import com.czapl.mygdxgame.MyGdxGame;

public class CannonTower extends CTower {

	public CannonTower() {
		super();
		m_range = 60;
		m_fireRate = 10;
		m_rotationSpeed = 10;
		m_staticSprite = MyGdxGame.towerAtlas.createSprite("tower4");
		m_cannonSprite = MyGdxGame.towerAtlas.createSprite("cannon1");
	}
	
	public CannonTower(CannonTower cannonTower) {
		super(cannonTower);
	}

	@Override
	public CTower clone() {
		return new CannonTower(this);
	}

	@Override
	protected void launchProjectile(IUnit unit) {
		IProjectile projectile = new CannonballProjectile(new Vector2(getX(), getY()));
		projectile.launch(unit);
		
	}
	
}
